@layout("/common/_curd/_container.html"){

	<form data-url="${basePath}/${code}/update" method="post" class="form-horizontal" role="form">
		<!-- 表单 -->
		@ var _table="tb_user_document";
		@ var _key="id";
		@ var _col=[
		@			  {name:"用户名", index:"name", type:"text",newline:true,length:8,required:"required"},
		@			  {name:"内容", index:"mark",type:"ueditor",newline:true,length:8,required:"required"},
		@			  {name:"状态", index:"status", type:"select_908",newline:true,length:8,required:"required"},
		@			  {name:"创建时间", index:"createTime", type:"text",newline:true,length:8,required:"required"},
		@			  {name:"修改时间", index:"modifyTime", type:"text",newline:true,length:8,required:"required"}	,			
		@			  {name:"所属银行", index:"bank_id",  type:"select_910",newline:true,length:8,required:"required"},		
		@			  {name:"银行业务", index:"bussiness_id", type:"hidden",newline:true,length:8,required:"required"}	
		@		   ];
		@ include("/common/_curd/_edit.html", {"col":_col, "table":_table, "key":_key}){}
				<div class="form-group form-bussiness" style="display: block">
			<label class="col-sm-2 control-label no-padding-right">银行业务 </label>
			<div class="col-sm-8">
				<select 
					class="form-control" id="bussiness_id">
					<option value=""></option>
				</select>
		
			</div>
		</div>
		<!-- 按钮 -->
		@ include("/common/_curd/_btn.html", {btn_save:"修改", btn_close:"关闭"}) {}
	</form>
	<script type="text/javascript">
		$(function() {
			changeBank();
			//任务下拉框联动  
			$(".form-area").insertAfter($("#_bank_id").parent().parent());
			function changeBank(){
				debugger
				var aReq=$("#_bussiness_id").val();
				var selectReq = $("#_bank_id").val();
				if(selectReq == "") return;
				$.ajax({
					url: "/template/getBussinessList/" + selectReq,
					type: "post",
					dataType: "json", // 接受数据格式   
					error: function() {
						alert("请求失败!");
					},
					success: function(data) {
						var str = "";
						if(data != null && data != "") {
							str += "<option value=''>请选择</option>";
							for(var i = 0; i < data.length; i++) {
								if(aReq == data[i].id*1){
									str += "<option selected = \"selected\" value='" + data[i].id + "'>" + data[i].name + "</option>";
								}else{
									str += "<option value='" + data[i].id + "'>" + data[i].name + "</option>";
								}
							}
						}
						$("#bussiness_id").html(str);
					}
				});
			}
			$("#_bank_id").bind("change", function() {
				changeBank();
			});
		});
	</script>
@}